<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>指令</title>
    <script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
</head>
<body>
<div ng-app="myApp">
    <h2>重复 HTML 元素（循环）</h2>
    <p ng-init="chars=['a','b','c']">
        <ul>
            <li ng-repeat="c in chars">
                {{c}}
            </li>
        </ul>
    </p>
    <p ng-init="users=[{name:'张三',age:34},{name:'张四',age:44},{name:'张五',age:45}]">
        <ul>
            <li ng-repeat="user in users">
                {{user.name+'：'+user.age}}
            </li>
        </ul>
    </p>
    <h2>自定义指令</h2>
    <p>
        <runoob-directive></runoob-directive>
        <div runoob-directive></div>
        <div class="runoob-directive"></div>
        <!-- directive: runoob-directive -->
    </p>
</div>
<script>
    var app = angular.module("myApp", []);
    app.directive("runoobDirective", function() {
        return {
            template : "<h4>自定义指令!</h4>"
        };
    });
</script>
</body>
</html>